<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>日常监管-生产报表页</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<jsp:include page="/scripts/common/index.html"></jsp:include>
<jsp:include page="/scripts/jquery/index.html"></jsp:include>
<jsp:include page="/scripts/dhtmlx/index.html"></jsp:include>
<jsp:include page="/scripts/bootstrap/index.html"></jsp:include>
<link rel="stylesheet" href="${basePath }style/default.css">
<style>
    h1,h2,h3 {
      text-align: center;
      font-size:18px;
    }
    .table1 {
      width: 100%;
      
      border-radius: 0 0 5px 5px;
      padding-bottom: 50px
    }
    .table1 table tr td, .Table1 table tr th {
      
      height: 26px;
    }
    .table1 table tr th {
       background:#0099cc;
       color:#fff
    }

  *{
		margin: 0;
		padding: 0
	}
		.top,.middle{
			
			float: left;
			height: 50px;
			padding: 5px 10px;
			margin:10px auto 0 auto;		
		}
		.middle {
		width:auto;}
		.top span, .middle{
			font-size: 12px;
		}
		.top input {
			display: inline;
			width:160px;
			background-color:#fff !important;
			cursor: pointer;
		}
		.content{
			width: 490px;
			height: 470px;
			padding: 10px 10px;
			margin:0 auto;
			
			border-top: none;
			border-radius: 0 0 5px 5px;

		}


		button {
			background-color:#0099CC;
			border:none;
			border-radius: 4px;
			width: 60px;
			height: 25px;
			color:#ffffff;
			margin-left:12px;
			font-size: 12px;
			-webkit-transition: all .3s ease-in;
			border:1px solid #fff;
		}
		button:hover {
			border:1px solid #0099CC;
			color: #0099CC;
			background-color: #fff;
		}
		td {
			padding:0 6px
		}
		select {
			height: 28px;
			font-size: 14px;
		}

		br {
			clear: both;
		}
		#header {
			width: 100%;
			border-radius: 5px 5px 0 0;
			padding-left:10%;
			border-bottom:1px solid #ccc;
		}
		.td1{
		text-align: left;
		}
		.td2{
		text-align: center;
		}
		.td3{
		text-align: right;
		}
</style>
	<script type="text/javascript">
	var timestart="";
	var timeend="";
	//设置预加载初始化
	function init() {
		//请求表格数据
		query();	
		var myCalendar = new dhtmlXCalendarObject({input:"vacationStartDate",button:"calendar_icon"});
		myCalendar.loadUserLanguage("zh");
		myCalendar.setDateFormat("%Y-%m");
		var myCalendar1 = new dhtmlXCalendarObject({input:"vacationStartDate1",button:"calendar_icon"});
		myCalendar1.loadUserLanguage("zh");
		myCalendar1.setDateFormat("%Y-%m");
	}
	
	function select(){
		var timestart=$("#vacationStartDate").val();
		var timeend=$("#vacationStartDate1").val();
		//alert(timestart);
		//alert(timeend);
	}
	//清除
	function clear(){
		$("#vacationStartDate").val("");
		$("#vacationStartDate1").val("");
	}
	//查询
	function query() {
		var v =  {};//
		var time= "";
		v["map.StartTime"] = $("#vacationStartDate1").val();//将选择的时间传入后台
		v["map.EndTime"] = timeend;//将选择的时间传入后台
		
		$('#MyForm').bootstrapValidator('validate');
			$.ajax({
				type : 'POST' ,
				url : 'page/bi/rcjg/getscinfo',
				data : v ,
				dataType : "json",
				async : true ,
				cache : false ,
				jsonpCallback : "null" ,
				success : function(response, status, statusText) {
					
						
						var table="";
						var row="";
						var tablecontent=response.content;
						console.log(tablecontent[0]);
						var ss="<tr>"
					        +"<th colspan='2' style='text-align: center;'>项目</th>"
					        +"<th style='text-align: center;'>计量单位</th>"
					        +"<th style='text-align: center;'>食品生产企业</th>"
					        +"<th style='text-align: center;'>食品添加剂生产企业</th>"
					        +"<th style='text-align: center;'>食品加工小作坊</th>"
					        +"</tr>";
						for(i=0;i<tablecontent.length;i++){
							
							var sss="<tr>";
							sss+="<td colspan='2'>"+tablecontent[i].XMNAME+"</td>";
							sss+="<td class='td2'>"+tablecontent[i].JLDW+"</td>";
							
							if(tablecontent[i].SPSC==null||tablecontent[i].SPSC=="undefined"){
								sss+="<td class='td3'>0</td>";
							}else{
								sss+="<td class='td3'>"+tablecontent[i].SPSC+"</td>";
							}
							if(tablecontent[i].SPTJJSC==null||tablecontent[i].SPTJJSC=="undefined"){
								sss+="<td class='td3'>0</td>";
							}else{
								sss+="<td class='td3'>"+tablecontent[i].SPTJJSC+"</td>";
							}
							
							if(tablecontent[i].SPJGXZF==null||tablecontent[i].SPJGXZF=="undefined"){
								sss+="<td class='td3'>0</td>";
							}else{
								sss+="<td class='td3'>"+tablecontent[i].SPJGXZF+"</td>";
							}
							
							ss=ss+sss+"</tr>";
						}
					$("#tables3").html(ss);
				} ,
				error : function(response, status, statusText) {
				} ,
				complete : function(response, status, statusText) {
				}
			});
		
	}
	//清除数据
	function clearData(){
		
		var arr = ["vacationStartDate","vacationStartDate1"];
		for(key in arr){
			$("#"+arr[key]+"").val("")
		}
		query();
	}
	</script>
<style type="text/css">
  br {
    clear: both;
  }
</style>
  </head>
  
 <body onload="init()" style="margin: 0;" margin-top="0">
  <div style="display: flex">
   <div id="tables" style="overflow:auto;width:auto;flex: 1;">
   
    <div id="header">
	<div class="top">
		<!--  	<span>统计时间:&nbsp;&nbsp;从</span>
		<input type="text" id="vacationStartDate" class="form-control" readonly="true" />-->
		<span>&nbsp;&nbsp;时间范围：&nbsp;&nbsp;</span>
		<input type="text" id="vacationStartDate1" class="form-control" readonly="true" />
	</div>
	<div class="middle">

		<button onclick="query()">查询</button>
		<button onclick="clearData()">清空</button>
	</div>
	<br>
	</div>
   

  <div id="Table2" class="table1" >
      <h1 style="margin: 24px 0">日常监管生产情况</h1>
    <table border="1" id="tables3" bordercolor="#ccc" width="80%" border-collapse="cellspacing" cellspacing="0" align='center' style="margin: 0 auto">
     
          
    </table>
        <br/><br/><br/>
    </div>
    </div>
   </div>
  </body>
</html>
